﻿using System;
using Lypshare.Net.Client;

namespace Lypshare.Flow
{
	/// <summary>
	/// Flow end point.
	/// </summary>
	/// <exception cref='ArgumentNullException'>
	/// Is thrown when an argument passed to a method is invalid because it is <see langword="null" /> .
	/// </exception>
    public class FlowEndPoint
    {
        // --------------------------------------------------------
        // Class Variables
        // --------------------------------------------------------


        /// <summary>
        /// The _connection.
        /// </summary>
        private IConnection _connection = null;


        /// <summary>
        /// The _id.
        /// </summary>
        private int _id = 0;


        // --------------------------------------------------------
        // Class Properties
        // --------------------------------------------------------


        /// <summary>
        /// Gets or sets the connection.
        /// </summary>
        /// <value>
        /// The connection.
        /// </value>
        public IConnection Connection
        {
            get { return _connection; }
            set { _connection = value; }

        } // Property: Connection


        /// <summary>
        /// Gets or sets the identifier.
        /// </summary>
        /// <value>
        /// The identifier.
        /// </value>
        public int Id
        {
            get { return _id; }
            set { _id = value; }

        } // Property: Id


        // --------------------------------------------------------
        // Class Functions
        // --------------------------------------------------------


        /// <summary>
        /// Initializes a new instance of the <see cref="Lypshare.Flow.FlowEndPoint"/> class.
        /// </summary>
        /// <param name='connection'>
        /// Connection.
        /// </param>
        /// <param name='id'>
        /// Identifier.
        /// </param>
        /// <exception cref='ArgumentNullException'>
        /// Is thrown when an argument passed to a method is invalid because it is <see langword="null" /> .
        /// </exception>
        public FlowEndPoint(IConnection connection, int id)
        {
            if (connection == null)
                throw new ArgumentNullException("connection");

            _connection = connection;
            _id = id;

        } // Constructor

    } // class FlowEndPoint
} // namespace Lypshare.Flow